package apIExercise.exception;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PIDemo {
    public static void main(String[] args) throws IOException {
        /*
        FileInputStream fis = new FileInputStream("dd.txt");
        InputStreamReader ios = new InputStreamReader(fis, StandardCharsets.UTF_8);
        BufferedReader bi = new BufferedReader(ios);
        int a;
        while ((a = bi.read()) != -1) {
            System.out.print((char) a);
        }
        bi.close();

         */
        FileInputStream fis=new FileInputStream("dad.txt");
        InputStreamReader ios=new InputStreamReader(fis,StandardCharsets.UTF_8);
        BufferedReader bi=new BufferedReader(ios);
        String line;
        while ((line=bi.readLine())!=null){
            System.out.println(line);
        }
        bi.close();

    }
}
